SOURCES= Console.o

CFLAGS=-nostdlib -nostartfiles -nodefaultlibs -fno-exceptions -nostdinc -fno-builtin \
	-I../Includes/Kernel -I../Includes/Console

LDFLAGS=-static -T../LinkerScripts/kernmodules.ld -Map ../binary/console.map

all: $(SOURCES) link

clean:
	-rm -f *.o

distclean: clean
	-rm -f ../binary/console.mod
	-rm -f ../binary/console.map

link:
	@echo [LD] ../binary/kernel.32
	@i586-elf-ld $(LDFLAGS) -o ../binary/console.mod $(SOURCES) -L../binary -lkernel

%.o : %.cpp
	@echo [CXX] $<
	@i586-elf-gcc $(CFLAGS) -c $<

%.o : %.s
	@echo [AS] $<
	@i586-elf-as $< -o $@

%.o : %.asm
	@echo [NASM] $<
	@nasm -f elf $< -o $@